<?php defined('SYSPATH') or die('No direct script access.');

class Model_Dao_SportPatient extends ORM{

	protected $_table_name  = 'sport_by_patient'; // default: accounts
    protected $_primary_key = 'id';      // default: id
    protected $_primary_val = 'sport_id';      // default: name (column used as primary value)
    
		    
	//'doctype_id'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    
    // default for $_table_columns: use db introspection to find columns and info
    // see http://v3.kohanaphp.com/guide/api/Database_MySQL#list_columns for all possible column attributes
    protected $_table_columns = array(
    	'id' => array('data_type' => 'int', 'is_nullable' => FALSE),
        'sport_id'   => array('data_type' => 'int',    'is_nullable' => FALSE),
    	'patient_id' => array('data_type' => 'int',    'is_nullable' => FALSE), 
        'age_at_start'  => array('data_type' => 'int', 'is_nullable' => FALSE),
    	'age_at_stop' => array('data_type'=>'int', 'is_nullable' => FALSE),
    	'hours_by_week' =>  array('data_type'=>'int', 'is_nullable' => FALSE)
    );
    
    //Relacion
    protected $_belongs_to = array('sport' => array('model'=>'dao_sport', 'foreign_key'=>'sport_id'));
    
	/*
    protected $_belongs_to = array(
								'doctype' => array('model' => 'dao_identitycard', 'foreign_key'=>'doctype_id'),
								'profession' => array('model'=>'dao_profession', 'foreign_key'=>'profession_id')
							);*/
	
	
 
}?>